<template>
	<view class="supervisioninformation">
		<titleName :name="name"></titleName>
		<view class="title-bgc"></view>
		<template v-if="admin">
			<view class="person-msg">
				<view class="name">
					<view class="left">姓名：</view>
					<view class="right">{{msg.username}}</view>
				</view>
				<view class="unit">
					<view class="left">单位：</view>
					<view class="right">{{msg.parentdepartmentname}}</view>
				</view>
				<view class="phone">
					<view class="left">手机号：</view>
					<view class="right">{{msg.mobile}}</view>
				</view>
				<view class="law-enforcement">
					<view class="left">执法证号：</view>
					<view class="right">{{msg.cardno}}</view>
				</view>
			</view>
		</template>
		<template v-if="!admin">
			<view class="line">
				<view class="left">
					<text class="star">*</text>
					<text class="text">执法人员1：</text>
				</view>
				<view class="right">{{msg.personnamefirst}}</view>
			</view>
			<view class="line">
				<view class="left">
					<text class="star">*</text>
					<text class="text">执法证号：</text>
				</view>
				<view class="right">{{msg.cardnofirst}}</view>
			</view>
			<view class="line">
				<view class="left">
					<text class="star">*</text>
					<text class="text">手机号：</text>
				</view>
				<view class="right">{{msg.mobilefirst}}</view>
			</view>
			<view class="line">
				<view class="left">

					执法人员2：
				</view>
				<view class="right">{{msg.personnamesecond}}</view>
			</view>
			<view class="line">
				<view class="left">

					执法证号：
				</view>
				<view class="right">{{msg.cardnosecond}}</view>
			</view>
			<view class="line">
				<view class="left">

					手机号：
				</view>
				<view class="right">{{msg.mobilesecond}}</view>
			</view>
		</template>
	</view>
</template>

<script setup>
	import titleName from '../../components/titleName.vue'
	import http from '../../request/index.js'
	import {
		onShow
	} from '@dcloudio/uni-app'
	import {
		ref
	} from 'vue'
	let name = ref("监管信息")
	let msg = ref({})
	let admin = ref()
	onShow(() => {
		admin.value = uni.getStorageSync('admin')
		if (admin.value) {
			name.value = "个人信息"
			http({
				url: '/user/selfinfo',
				
			}).then((res) => {
				console.log(res, 'res');
				msg.value = res.data
			})
		} else {
			name.value = "监管信息"
			http({
				url: '/enviMonitorPerson/detail'
			}).then((res) => {
				if (res.code == 0) {
					msg.value = res.data
				}
			})
		}
	})
</script>

<style lang="scss" scoped>
	.supervisioninformation {
		width: 100vw;
		height: 100vh;
		padding-top: 160rpx;
		overflow: hidden;

		.title-bgc {
			background: #0874FA;
			height: 160rpx;
			width: 100vw;
			position: fixed;
			top: 0;
			left: 0;
			z-index: 9;
		}

		.person-msg {
			padding-top: 20rpx;

			.name,
			.unit,
			.phone,
			.law-enforcement {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding-left: 32rpx;
				padding-right: 44rpx;
				height: 100rpx;
				line-height: 100rpx;

				.left {

					font-weight: 400;
					font-size: 28rpx;
					color: #000000;

				}

				.right {

					font-weight: 400;
					font-size: 28rpx;
					color: #333333;

				}
			}
		}

		.line {
			padding-top: 20rpx;
			padding-left: 32rpx;
			padding-right: 44rpx;
			display: flex;
			justify-content: space-between;
			line-height: 120rpx;

			.left {
				display: flex;
				font-weight: 400;
				font-size: 28rpx;
				color: #000000;

				.star {
					color: #FA0808;
				}

				.text {
					color: #000000;
				}
			}

			.right {

				font-weight: 400;
				font-size: 28rpx;
				color: #333333;

			}
		}




	}
</style>